package com.collection.provider.biz;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.collection.api.entity.sys.SysResource;
import com.collection.provider.business.dao.sys.SysResourceMapper;

import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;


@Service
public class SysResourceBiz {

	@Autowired
	private SysResourceMapper sysResourceMapper;
    
	
	 public int deleteByPrimaryKey(Integer id) {
		return sysResourceMapper.deleteByPrimaryKey(id);
	}

	 public int insert(SysResource record) {
		return sysResourceMapper.insert(record);
	}

	 public int insertSelective(SysResource record) {
		return sysResourceMapper.insertSelective(record);
	}

	 public SysResource selectByPrimaryKey(Integer id) {
		return sysResourceMapper.selectByPrimaryKey(id);
	}

	 public int updateByPrimaryKeySelective(SysResource record) {
		return 0;
	}

	 public int updateByPrimaryKey(SysResource record) {
		return sysResourceMapper.updateByPrimaryKey(record);
	}
    
    /**
     * 功能描述:查找所有资源
     */
	public List<Map<String, Object>> findAllResource(Map<String,Object> map) {
		return  sysResourceMapper.findAllResources(map);
	}
	
	public List<SysResource> findAllResource() {
		return  sysResourceMapper.findAllResource();
	}

	
	//资源总条数
	public int findAllResourceCount() {
		return sysResourceMapper.findAllResourceCount();
	}
	
	
    /**
     * 功能描述:通过roleId查找资源
     */
    public List<SysResource> findResourceByRoleId(int roleId) {
		return null;
	}

    /**
     * 功能描述:根据parentId查询权限资源
     */
    public List<SysResource> findAllResourceByParentId(@Param("parentId") int parentId) {
		return null;
	}

    /**
     * 功能描述:根据条件查询权限资源
     */
    public List<SysResource> findResourceByParams(Map<String, Object> params) {
		return null;
	}

    /**
     * 功能描述:删除角色对应的资源
     */
    public int delRoleMRessourceByRoleId(@Param("roleId") int roleId) {
		return 0;
	}
}
